// dlg.txt

//MK Edit	

//mark_quest_dest(zone,x,y,layer,quest);
//	code =
//		sf(,,2);
//		toggle_quest(19,10);
//		award_party_xp(MED_QUEST_XP);
//	break;

begintalkscript;

variables;

short this_town = 46;

begintalknode;
	tag = 1;
	condition = get_sdf(this_town,1) == 0;
	text1 = "You approach the Erud Foundry. The odors of alchemy and burning coal cut easily through the chill air. The piles of ore nearby suggest that a lot of quicksilver is produced here as well. A potentially valuable installation to control.";
	text2 = "However, something is off. No smoke rises from the chimney. Nobody is visible. You see no merchants, guards, or workers. A little shiver goes up your spine. When a settlement of mages goes quiet like this, something has likely gone wrong.";
	code =
		sf(this_town,1,1);
	break;
	
begintalknode;
	tag = 2;
	condition = get_sdf(this_town,2) == 0;
	text1 = "A wave of hot air washes over you. You smell sulfur. Looking around, you see shambling humanoid figures that weren't there a moment before.";
	text2 = "They look like magical constructs. Beefy, mindless, scaly brutes. They lunge toward you, snarling. Then then raise their clawed hands, and little balls of fire appear on the palms.";
	text3 = "Definitely a magical disaster site in need of urgent cleaning. The Erudico are no more reliable than wizards anywhere else in the Empire.";
	code =
		sf(this_town,2,1);
		activate_hidden_group(1);
	break;

begintalknode;
	tag = 3;
	condition = get_sdf(this_town,3) == 0;
	text1 = "You enter the main hall of the foundry. Some flaming disaster, probably goblin-related, caused most of the building to burn down. The surviving Erudico put out most of the flames before they fled. The goblins likely remain.";
	text2 = "There are several people hiding just inside the building. Actual, friendly humans. They wear the long robes of the Erudico. When they see who you are, they sigh with relief.";
	code =
		sf(this_town,3,1);
		if (gf(46,13) > 0)
			rs(2);
	break;

begintalknode;
	tag = 4;
	condition = get_sdf(this_town,4) == 0;
	text1 = "You enter the tunnels under the charred building above. It's a lot hotter down there, and the reek of sulfur is overpowering.";
	text2 = "Each step you take, the more magic you can sense in the air. You still don't know exactly how the Erudico here screwed things up, but you're close to where it happened.";
	code =
		sf(this_town,4,1);
	break;

begintalknode;
	tag = 5;
	condition = get_sdf(this_town,5) == 0;
	text1 = "__";
	code =
		sf(this_town,5,1);
	break;

begintalknode;
	tag = 6;
	condition = get_sdf(this_town,6) == 0;
	text1 = "__";
	code =
		sf(this_town,6,1);
	break;

begintalknode;
	tag = 7;
	condition = get_sdf(this_town,7) == 0;
	text1 = "__";
	code =
		sf(this_town,7,1);
	break;

begintalknode;
	tag = 8;
	condition = get_sdf(this_town,8) == 0;
	text1 = "__";
	code =
		sf(this_town,8,1);
	break;

begintalknode;
	tag = 9;
	condition = get_sdf(this_town,9) == 0;
	text1 = "__";
	code =
		sf(this_town,9,1);
	break;

begintalknode;
	tag = 10;
	condition = get_sdf(this_town,10) == 0;
	text1 = "__";
	code =
		sf(this_town,10,1);
	break;

begintalknode;
	tag = 11;
	condition = get_sdf(this_town,11) == 0;
	text1 = "__";
	code =
		sf(this_town,11,1);
	break;

begintalknode;
	tag = 12;
	condition = get_sdf(this_town,12) == 0;
	text1 = "__";
	code =
		sf(this_town,12,1);
	break;

// MIXED

begintalknode;
	tag = 13;
	condition = 1;
	text1 = "There is an enormous brute sitting in the magic circle, crunching human bones between his teeth. The circle has a break in the outer line, a long single scratch. It is useless to contain the beast.";
	text2 = "The Erudico who called the brute had their reasons, you're sure. When it appeared and immediately broke out of their circle, they probably had a few moments to contemplate their errors before the thing killed them.";
	text3 = "At least you know what the problem is. Fixing it is another matter.";

begintalknode;
	tag = 14;
	condition = 1;
	text1 = "The brute raises a hand and mutters a spell of calling in its gutteral, infernal tongue. A fire goblin appears on one of the small platforms.";
	text2 = "This would explain why so few of the foolish Erudico escaped. The head brute could call hunters to track them down. Once caught, they were brought back for speedy devouring.";
	
begintalknode;
	tag = 15;
	condition = 1;
	text1 = "With a final blow, the massive goblin is destroyed. It collapses to the ground and immediately breaks down into foul, black, bubbling goo. The curse is lifted. Once someone shows up with a mop, this workshop can be restored to functionality.";
	text2 = "This could be a useful source of quicksilver, but, of course, you can't process it yourself. Perhaps someone in Jajayim can be useful.";

begintalknode;
	tag = 16;
	condition = 1;
	text1 = "This door is barred from the inside. It feels ominously warm when you touch it.";

begintalknode;
	tag = 17;
	condition = 1;
	text1 = "This stairway ends at a giant pile of charred timbers. The upper floor of the workshop is a total ruin.";

begintalknode;
	tag = 18;
	condition = 1;
	text1 = "One of the massive goblin's constructs has been destroyed. The goblin lord cries out in grief and rage!";
	text2 = "Then it reaches out, pointing at the little pet's smoldering corpse. The massive creature draws the remaining power out of the dead construct, absorbing it. The huge beast is instantly faster and more vicious.";

begintalknode;
	tag = 19;
	condition = 1;
	text1 = "This box is a jumble of paper. Torn, greased sheets of parchment, covered with notes, theories, and incoherent ramblings. You look for notes on the summoning of goblins, but you find nothing relevant.";
	text2 = "Under the mess, you find an intact journal. The title is on the front: _Lies of the Dead._ It is one Erud's record of conversations he has had with the ghosts wandering the High Litha.";
	text3 = "Seems like it might make interesting campfire reading. You take it.";
	code =
		if (gf(46,9) == 0) {
			sf(46,9,1);
			set_spec_item(35,1);
			}
			else {
				rs(2);
				rs(3);
				}
	break;

begintalknode;
	tag = 20;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 21;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 22;
	condition = 1;
	text1 = "__";

////

begintalknode;
	tag = 30;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Name";
	text1 = "You get a closer look at the three humans in the hall. They are young Erudico. They're protected by robes, armed with enchanted staves, and completely inadequate to face the challenges here.";
	text2 = "One of them steps forward. She gives a little bow. _Hello. Thank you. We were trapped in here. I am Phair. We weren't ... weren't ... You are from Haven?_";


begintalknode;
	state = 10;
	nextstate = 11;
	condition = 1;
	question = "_I am [P] [N] of the Empire of Haven._";
	text1 = "_I thought so! It's such an honor to be saved by you. We will be fleeing now. We hope, if you keep exploring, you are careful._";

begintalknode;
	state = 10;
	nextstate = 11;
	condition = 1;
	question = "_You are correct._";
	text1 = "_I thought so!_ She looks at the insignia on your shoulder. _And important, too! It's such an honor to be saved by you. We will be fleeing now. We hope, if you keep exploring, you are careful._";

begintalknode;
	state = 10;
	nextstate = 11;
	condition = 1;
	question = "_Ummm ... Haven? Never heard of it._";
	text1 = "She looks at the insignia on your shoulder. _Oh. You are traveling in secret. Of course. We won't interfere. It's such an honor to be saved by you. We will be fleeing now. We hope, if you keep exploring, you are careful._";

begintalknode;
	state = 11;
	nextstate = 12;
	condition = 1;
	question = "_Careful? Why so?_";
	text1 = "_Well, we're here to scout out the foundry. We wanted to know if it was safe here. It is not. The workshops, the quicksilver works, and several of our teachers, were lost due to experiments._";
begintalknode;

	state = 12;
	nextstate = -1;
	condition = gf(43,18) == 1;
	question = "_Erud Oxana sent me._";
	text1 = "_We're not surprised. It's good to know she's looking after us!_";

begintalknode;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "_What sort of experiments?_";
	text1 = "_We aren't sure. Something in the basement. The survivors said that their instructors had formed a habit of spending nights down there. Forbade any workers or students from going down._";
	text2 = "_Suspicious behavior, really. Someone should have told the tower._";

begintalknode;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "_Are you here to clean up the mess?_";
	text1 = "She grimaces. _No! We are only scouts, and we managed to get trapped just coming this far._";
	text2 = "_We're leaving. We're going back to Jajayim to tell Erud Oxana what we found._";

begintalknode;
	state = 12;
	nextstate = 13;
	condition = 1;
	question = "_You say there's quicksilver here?_";
	text1 = "_Not right now, but there can be. That was the main purpose of this place. We turn cinnabar into precious quicksilver._";
	text2 = "_Ummmm. Haven is rebuilding it's forts, correct?_ She looks at the insignia again and wonders how much authority you have. _Are you interested in getting more quicksilver?_";

begintalknode;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "_I am._";
	text1 = "_We answer to Erud Oxana, in Jajayim. If you can reclaim the foundry we so carelessly lost, I know she would pay a bounty. Now, excuse me. We need to leave while we can survive._";
	text2 = "They bow and leave the ruin to the south.";
	action = END_TALK;
	code =
		erase_char(30002);
	break;
	
begintalknode;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "_We're good, thanks._";
	text1 = "_All right, glad to hear it. I know that is the tactical thing to say._ She winks.";
	text2 = "_If you change your mind, we answer to Erud Oxana, in Jajayim. Whoever can reclaim the foundry we so carelessly lost, I know she would pay them a bounty. Now, excuse me. We need to leave while we can survive._";
	text3 = "They bow and leave the ruin to the south.";
	action = END_TALK;
	code =
		erase_char(30002);
	break;
	

	
//

begintalknode;
	tag = 40;
	state = -1;
	nextstate = 40;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

	
//

begintalknode;
	tag = 70;
	state = -1;
	nextstate = 70;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";


//

begintalknode;
	tag = 100;
	state = -1;
	nextstate = 100;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 100;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

//

begintalknode;
	tag = 130;
	state = -1;
	nextstate = 130;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 130;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

//

begintalknode;
	tag = 160;
	state = -1;
	nextstate = 160;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 160;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";
		
//

begintalknode;
	tag = 190;
	state = -1;
	nextstate = 190;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 190;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";
				